package com.plian.system.wrapper.im;

import com.plian.system.dto.im.ExecutionProjectSituationDTO;
import com.plian.system.entity.im.ExecutionProjectSituation;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.im.ExecutionProjectSituationVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * @description:
 * @author: gangan
 * @create: 2021-02-19 14:14
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface ExecutionProjectSituationWrapper extends BaseWrapper<ExecutionProjectSituation, ExecutionProjectSituationDTO, ExecutionProjectSituationVO> {

    /**
     * Entity转VO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mappings(value = {
            @Mapping(source = "projectNatureId", target = "projectNatureName", qualifiedByName = DICT_CODE_TO_NAME),
            @Mapping(source = "isFund", target = "isFundStr", qualifiedByName = IS_OR_NO),
            @Mapping(source = "isMain", target = "isMainStr", qualifiedByName = IS_OR_NO)

    })
    ExecutionProjectSituationVO entityToVO(ExecutionProjectSituation entity);
}